<?php

namespace Biz\model;

/**
 *
 * @author Luomo
 *
 */
class TradeMsg extends \Doraemon\pockets\datebase\BaseDbModel
{

    const _CONFIG_FILE_ = 'db_trade_msg';

    const _CONFIG_SELECT_ = 'db_trade_msg';

    const _DATABASE_ = 'biz_trademsg';

    const _TABLE_NAME = 'trade_msg';

    const STATUS_NORMAL = 1;

    const STATUS_DEL = 0;

    public static function getMsgList($uid, $start_id, $limit)
    {
        $whereAnd = [
            "to_uid" => $uid,
            "status" => self::STATUS_NORMAL
        ];
        if ($start_id) {
            $whereAnd["id[<]"] = $start_id;
        }
        $msgList = self::select("*", [
            "AND" => $whereAnd,
            "ORDER" => [
                "id" => "DESC"
            ],
            "LIMIT" => $limit
        ]);
        return $msgList;
    }
}

